﻿// 获取文档宽度和窗口宽度
const docWidth = document.documentElement.scrollWidth;
const windowWidth = window.innerWidth;
//const docHeight = document.documentElement.scrollHeight;
//const windowHeight = window.innerHeight;

// 计算滚动条居中位置
const scrollPositionX = (docWidth - windowWidth) / 2;
//const scrollPositionY = (docHeight - windowHeight) / 2;

// 将滚动条位置设置为居中
window.scrollTo(scrollPositionX, 0);
